﻿using System;
using System.Collections.Generic;
using GameFramework.Battle.Core;
using Gameplay.PVE.Utils;
using RootMotion.FinalIK;
using UnityEngine;

namespace Gameplay.PVE.Survivor
{
    public class ControlElement: ElementBase
    {
        private float duration;
        public Vector3 sourcePosition;
        public override void Execute()
        {
            sourcePosition = bullet.Position;
            this.duration = target.AddControlAction(this);
        }

        public override float GetDuration()
        {
            return duration;
        }

        public override void OnFree()
        {
            target.RemoveControlAction(this);
        }

        public override bool IsImmediate()
        {
            return false;
        }
    }
}
